package pb1;

public class MainPb1 {

	/**
	 * Problema Siracuza
	 */
	public static void siracuzaIterativ(int n){		
		System.out.println(n);
		while(n!=1){
		if(n%2==0){
			n=n/2;
			
		}
		else{
			
			n=n*3+1;
			
		}
		System.out.println(n);
	}
		
	}
	public static void siracuzaRecursiv(int n){
		System.out.println(n);
		if(n!=1){
			if(n%2==0){
				
				
				siracuzaRecursiv(n/2);
			}
			else{
				
				
				
				siracuzaRecursiv(n*3+1);
			}
		}
		
	}
	public static void main(String[] args) {
		int n=20;
		siracuzaIterativ(n);
	//	siracuzaRecursiv(n);
		

		
	

	}

}
